<%@ page import="java.sql.Connection" %>
<%@ page import="java.sql.Statement" %>
<%@ page import="java.sql.DriverManager" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2018/4/3
  Time: 16:53
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
<html>
<head>
    <title>Title</title>
</head>

<body>

<%@ include file="isLogin.jsp" %>
<%--<jsp:include page="isLogin.jsp" />--%>

<%
    //配置字符编码集
    request.setCharacterEncoding("utf8");

    //读取jsp中的数据并封装
    String username = request.getParameter("username");
//    request.setAttribute("username", username);
    String password = request.getParameter("password");
//    request.setAttribute("password", password);
%>

<sql:setDataSource var="datasource" driver="com.mysql.jdbc.Driver"
                   url="jdbc:mysql://localhost:3306/sctu_javaweb_2018?serverTimezone=UTC"
                   user="root"
                   password="123456"
                   scope="request"/>
<sql:update var="insert" dataSource="${datasource}">
    insert into t_users(username,password) values('"+username+"','"+password+"')
    <sql:param value="100"/>
    <sql:param>jstl</sql:param>
</sql:update>


<%--<%@ include file="footer.jsp" %>--%>

插入成功！！！

<jsp:include page="footer.jsp">
    <jsp:param name="year" value="2015"/>
</jsp:include>

</body>
</html>